<%--
  Created by IntelliJ IDEA.
  User: 15c
  Date: 2018/1/27
  Time: 1:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
  <title>知游管理系统</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- CSS Libs -->
  <link rel="stylesheet" type="text/css"
        href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  <!-- CSS App -->
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/indexStyle.css">
  <link rel="stylesheet" type="text/css"
        href="${pageContext.request.contextPath}/resource/bootstrap-3.3.7-dist/css/flat-blue.css">
  <style>
    .nav-li:hover {
      border-bottom: 1px solid #ccc
    }
  </style>
  <%--获取时间--%>
  <script type="text/javascript">
    function setDateTime() {
      var date = new Date();
      var day = date.getDay();
      var week;
      switch (day) {
        case 0:
          week = "星期日";
          break;
        case 1:
          week = "星期一";
          break;
        case 2:
          week = "星期二";
          break;
        case 3:
          week = "星期三";
          break;
        case 4:
          week = "星期四";
          break;
        case 5:
          week = "星期五";
          break;
        case 6:
          week = "星期六";
          break;
      }
      var hours = (date.getHours() < 10) ? "0" + date.getHours() : date.getHours();
      var minutes = (date.getMinutes() < 10) ? "0" + date.getMinutes() : date.getMinutes();
      var seconds = (date.getSeconds() < 10) ? "0" + date.getSeconds() : date.getSeconds();
      var today = date.getFullYear() + "年" + (date.getMonth() + 1) + "月"
              + date.getDate() + "日 " + week + " " + hours + ":"
              + minutes + ":" + seconds;
      document.getElementById("today").innerHTML = today;
    }
    window.setInterval("setDateTime()", 1000);
  </script>

</head>

<body class="flat-blue">
<div class="app-container">
  <div class="row content-container">
    <nav class="navbar navbar-default navbar-fixed-top navbar-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-expand-toggle">
            <span class="fa fa-bars icon"></span>
          </button>
          <ol class="breadcrumb navbar-breadcrumb">
            <li class="active">课程路线查看结果</li>
          </ol>
          <button type="button" class="navbar-right-expand-toggle pull-right visible-xs">
            <span style="font-size: 18px" class="glyphicon glyphicon-chevron-left"></span>
          </button>
        </div>
        <ul class="nav navbar-nav navbar-right">
          <button type="button" class="navbar-right-expand-toggle pull-right visible-xs">
            <span style="font-size: 18px" class="glyphicon glyphicon-chevron-up"></span>
          </button>
          <%
            if (null != session.getAttribute("admin")) {%>
          <li class="admin" style="float: left">
            <img class="img-responsive" width="80%" height="80%"
                 src="${pageContext.request.contextPath}/images/avtar.png"/>
          </li>
          <li class="admin" style="float: left;margin-right: 20px">
            <h5>欢迎管理员：<span style="color: #dd3e3e"><%=session.getAttribute("admin")%></span></h5>
            <i class="glyphicon glyphicon-time"></i><span id="today"></span>
          </li>
          <%}%>
        </ul>
      </div>
    </nav>
    <div class="side-menu sidebar-inverse">
      <nav class="navbar navbar-default" role="navigation">
        <div class="side-menu-container">
          <div class="navbar-header">
            <a class="navbar-brand" href="#">
              <div class="icon fa  fa-mortar-board"></div>
              <div class="title">ZhiYou Management
              </div>
            </a>
            <button type="button" class="navbar-expand-toggle pull-right visible-xs">

            </button>
          </div>
          <ul class="nav navbar-nav">
            <li class="nav-li">
              <a href="${pageContext.request.contextPath}/index">
                <span class="icon fa   fa-bars"></span><span class="title">首页</span>
              </a>
            </li>
            <li class="nav-li">
              <a href="${pageContext.request.contextPath}/admin/list">
                <span class="icon fa fa-user"></span><span class="title">查看用户</span>
              </a>

            </li>
            <li class="nav-li">
              <a href="${pageContext.request.contextPath}/admin/show/type">
                <span class="icon fa fa-pencil"></span><span class="title">添加类型</span>
              </a>

            </li>
            <li class="nav-li">
              <a  href="${pageContext.request.contextPath}/admin/classlist">
                <span class="icon fa fa-file-o"></span><span class="title">查看课程</span>
              </a>

            </li>


            <li class="nav-li">
              <a href="${pageContext.request.contextPath}/admin/add/class">
                <span class="icon fa fa-pencil-square-o"></span><span class="title">添加课程</span>
              </a>

            </li>

            <li id="login-li" class="nav-li">
              <%--"<% if (null == session.getAttribute("admin")) {%>--%>
              <%--${pageContext.request.contextPath}/login--%>
              <%--<%}else {%>--%>
              <%--<%}%>"--%>
              <a id="login-a" href="">
                <span class="icon fa fa-paw"></span><span class="title">登录系统</span>
              </a>

            </li>

            <li id="loginOut-li" class="nav-li">
              <a id="loginOut-a" href="" onclick="check()">
                <span class="icon fa fa-reply"></span><span class="title">退出系统</span>
              </a>

            </li>
          </ul>
        </div>

      </nav>
    </div>

    <!-- Main Content -->
    <div class="container-fluid">
      <div class="side-body">
        <div class="row">
          <div class="col-xs-12">
            <div class="card">
              <div class="card-header">

                <div class="card-title">
                  <%--<div class="title">欢迎使用</div>--%>

                </div>
              </div>
              <div class="card-body">
                <div style="font-size: 18px;font-weight: bold">抱歉，该课程还暂无路线！<a style="color: #1d7dff"  href="${pageContext.request.contextPath}/admin/classlist">返回</a>
                  <a style="color: #1d7dff"  href="${pageContext.request.contextPath}/admin/add/line?classId=${classId}">点击添加路线</a>

                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

</div>
<%--弹出窗--%>

</body>


<!-- Javascript Libs -->
<script type="text/javascript"
        src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

<script type="text/javascript"
        src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>

<!-- Javascript -->
<script type="text/javascript" src="${pageContext.request.contextPath}/js/indexApp.js"></script>


<script type="text/javascript">
    var admin = <%=session.getAttribute("admin")%>;


    //登录验证
    $("#login-li").click(function () {
        if (admin != null) {
            alert("你已经登录")
        } else {
            $("#login-a").attr('href', '${pageContext.request.contextPath}/login');
        }
    });

    //登出验证
    $("#loginOut-li").click(function () {
        if (admin == null) {
            alert("你还未登录")
        } else {

            if (confirm("您确定要退出吗?")) {
                $("#loginOut-a").attr('href', '${pageContext.request.contextPath}/logout?uname=' + admin);

            }

        }


    });


</script>

</html>

